package com.itheima.edu.manager.controller;

import com.itheima.edu.manager.domain.Teacher;

public class OtherTeacherController extends BaseTeacherController {
    //抽取一个方法,用于键盘录入老师信息,封装老师对象并返回
    public Teacher inputTeacherInfo(String id) {
        System.out.println("请输入老师姓名:");
        String name = sc.next();
        System.out.println("请输入老师年龄:");
        String age = sc.next();
        System.out.println("请输入老师出生日期:");
        String birthday = sc.next();

        //2.将用户录入的老师信息封装成一个老师对象
        //优化点: 当前对象的创建优化成:  带参构造创建对象!
        //遵守开闭原则:  对扩展开放,对修改关闭.
        Teacher tea = new Teacher(id,name,age,birthday);

        //返回封装好的老师对象
        return tea;
    }
}
